package de.tabuma.pm.htmlcontent.logik;

import de.tabuma.pm.logik.*;
import de.tabuma.pm.htmlcontent.entity.*;
import java.util.*;

/**
 *
 * @author alefen
 */
public class HtmlContentFacade {
    public static int create(HtmlContent htmlContent, String user) {
        return (int) PMF.doCreate(htmlContent, user);
    }

    public static HtmlContent get(int id) {
        return (HtmlContent) PMF.get((int) id, new HtmlContent());
    }

    public static void update(HtmlContent htmlContent, String user) {
        PMF.doUpdate(htmlContent, user);
    }

    public static void remove(int id, String user) {
        HtmlContent htmlContent = get(id);
        PMF.doRemove(htmlContent, user);
    }

    public static HtmlContent getFromProjectnavigationId(int id) {
        String keys[] = new String[1];
        keys[0] = "projectnavigationId";
        String values[] = new String[1];
        values[0] = "" + id;
        List<HtmlContent> hcList = PMF.get(keys, values, new HtmlContent());
        if(hcList.size()>0) {
            return hcList.get(0);
        }
        return null;
    }
}
